package com.zcp.todayheadline.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.zcp.todayheadline.R;

/**
 * Created by zcp on 2017/1/5.
 */

public class LoginBaseAda extends BaseAdapter {

    //条目数组
    String[] items = new String[]{"消息通知", "活 动", "头条商城", "京东特供 新人领188元红包", "我要爆料", "用户反馈"};
    Context context;

    public LoginBaseAda(Context context) {
        this.context = context;
    }

    @Override
    public int getCount() {
        return items.length;
    }

    @Override
    public Object getItem(int position) {
        return items[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        //找布局
        convertView = View.inflate(context, R.layout.login_lv_item, null);
        TextView tv_items = (TextView) convertView.findViewById(R.id.tv);
        tv_items.setText(items[position]);
        return convertView;
    }
}
